#pragma once

template <class T>
class Singleton
{
public:
    static T * get() {
        if(NULL == s_pInstance) {
            s_pInstance = new T();
        }

        return s_pInstance;
    }

    virtual ~Singleton() {}

private:
    static T *s_pInstance;

protected:
    Singleton() {}
};

template <class T>
T * Singleton<T>::s_pInstance = NULL;